
import { createRouter, createWebHashHistory, createWebHistory } from 'vue-router'
import MoveShop from '../views/MoveShop.vue'

//创建路由配置实例
const routes = [
    {
        path: '/home',
        name: 'home',
        component: () => import('../views/Home.vue'),
        // show 为true 表示在导航栏显示 菜单内展示，false表示不显示
        //useframe 为true 表示全屏展示 为false 不全屏 在main里面嵌套展示
        meta: { title: "首页", show: true, icon:'House',useframe: false}
    },
    {
        path: '/moveshop',
        name: 'moveshop',
        component: MoveShop,
        meta: { title: "移动端首页", show: true, icon: 'Iphone', useframe: true }
    },
    {
        path: '/moveDetail',
        name: 'moveDetail',
        component: () => import('../views/MoveDetail.vue'),
        meta: { title: "商品详情页", show: true, icon: 'Iphone', useframe: true }
    },
    {
        //一级路由
        path: '/product', //路由的url地址 
        component: () => import('../views/product/index.vue'), // 路由的页面
        meta: { title: "商品管理", show: true, icon: 'MilkTea' }, //路由的元信息（自定义属性）
        // 二级路由 嵌套路由
        children: [
            {
                path: '/product/list',
                component: () => import('../views/product/List.vue'),
                meta: { title: "商品列表", show: true, icon: 'List' }
            }
        ]
    }
]

//创建路由实例对象
const router = createRouter({
    history: createWebHistory(),
    routes
})
//导出路由 让别人使用
export default router
